//
//  ViewController.m
//  UI01_UIViewHomeworkThird
//
//  Created by dllo on 16/6/3.
//  Copyright © 2016年 lanou. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    for (NSInteger i = 0;i < 5;i++){
        for (NSInteger j = 0;j < 8;j++){
            [self creatRandomColorSquareWithFrame:CGRectMake(83 * i, 92 * j, 83, 92)];
        }
    }
    
    
    
    
    
    
    // Do any additional setup after loading the view, typically from a nib.
}

-(void)creatRandomColorSquareWithFrame:(CGRect)frame{
    UIView *view = [[UIView alloc] initWithFrame:frame];
    view.backgroundColor = [UIColor colorWithRed:(arc4random() % 255)/255.0 green:(arc4random() % 255) / 255.0 blue:(arc4random() % 255) /255.0 alpha:1];
    [self.view addSubview:view];
    [view release];
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
